package com.rany.day03.demo05;

import java.util.ArrayList;
import java.util.Random;

public class Member extends User {
    public Member() {
    }

    public Member(String name, int money) {
        super(name, money);
    }

    //当前成员本来有多少钱
    int money = super.getMoney();


    public void receive(ArrayList<Integer> list){
        int index = new Random().nextInt(list.size());

        //获取红包金额
        int integer = list.remove(index);
        System.out.println(integer);
        //收到的钱
        super.setMoney(integer+money);
    }
}
